package cn.btks.databasehandler.handle.service;

import cn.btks.commonserver.result.ResultState;
import cn.btks.databasehandler.handle.pojo.BackUpConfig;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @Author lijun
 * @Date 2020/12/28 12:07
 */
public interface BackUpConfigService {

    /**
     * 根据ID查询备份配置信息
     * @param id
     * @return
     */
    BackUpConfig findById(Long id);

    /**
     * 查找所有启动的备份配置
     * @return
     */
    List<BackUpConfig> findAllStartConfig();

    /**
     * 按条件分页查询备份配置信息
     * @param page
     * @param pageSize
     * @param configName
     * @param configMode
     * @param configCycle
     * @return
     */
    ResultState findPagesByConfigNameAndConfigModeAndConfigCycle(Integer page, Integer pageSize, String configName, Integer configMode, Integer configCycle);

    /**
     * 保存配置信息
     * @param backUpConfig
     * @return
     */
    ResultState save(BackUpConfig backUpConfig, HttpServletRequest request) throws Exception;

    /**
     * 保存配置信息
     * @param backUpConfig
     * @param request
     * @return
     */
    ResultState update(BackUpConfig backUpConfig,HttpServletRequest request) throws Exception;

    /**
     * 更新备份配置是否启动
     * @param id
     * @param isStarted
     * @return
     */
    int updateIsStarted(Long id,Integer isStarted);

    /**
     * 根据ID删除配置信息
     * @param id
     * @return
     */
    ResultState delete(Long id);
}
